<?php 
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
session_start(); 
} 

$role = $_SESSION['role'];
$_SESSION['posmanager']=0;
$_SESSION['poscoder']=0;
$_SESSION['postest']=0;//manager 3;coder 1; tester 2
$_SESSION['idviewpro']='';

if(array_key_exists("page",$_GET))
        $page  = $_GET['page'];
    else
        $page = 1;
    

    $abc = ($page-1)*10;

include 'operations/connection.php';

$querydetail=mysql_query("SELECT p.NameProject, p.Description,DATE_FORMAT( p.DateStart, '%Y-%m-%d') as DateStart, p.DateComplete, p.IDManager,p.IDView, p.Status
FROM pr_project p,pr_composition c, employee e WHERE ((c.IDEmployee = '$id_employee'  AND e.IDEmployee = c.IDEmployee )
 or (p.IDManager = '$id_employee'  AND e.IDEmployee = p.IDManager )) AND p.IDProject = c.IDProject AND  p.IDProject ='$id'
 GROUP BY p.IDProject ORDER BY p.NameProject ASC 
");

$queryLstMember=mysql_query("SELECT c.IDComposition, c.IDEmployee, c.IDProject, c.Position, c.Status, e.UserName, e.FullName,
        		 e.Position as PositionEmp,e.Email,c.REmail FROM pr_composition c, employee e 
        		 WHERE c.IDProject = '$id' AND c.IDEmployee = e.IDEmployee and c.Status=0 and e.State = 1 ");

$selectpriority = mysql_query("select pc.id,pc.backgroundColor from priority_color pc");
$valpriocolor = array();
while ($row_pri = mysql_fetch_array($selectpriority)){
	$valpriocolor[$row_pri['id']] = $row_pri['backgroundColor'];
}

$queryDepartment = mysql_query("SELECT d.IDDepartment,dl.DepartmentName FROM department d,department_lang dl WHERE d.IDDepartment=dl.IDDepartment AND dl.LangID='$lang';");
$querySendMail = mysql_query("SELECT e.IDEmployee,e.FullName FROM list_sendmailproject l,employee e 
WHERE  e.IDEmployee=l.id_employee AND l.id_main_employee='$id_employee' AND l.id_project='$id' GROUP BY l.id_employee");

include 'popup/popup_sendmailProject.php';
?>
<style>
<!--
* {padding:0; margin:0;}
-->
</style>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="admin/attach/js/webtoolkit.aim.js"></script>
<script type="text/javascript" src="admin/attach/js/myattach.js"></script>
<link href="admin/attach/css/myattach.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="admin/attachcomment/js/webtoolkit.aim.js"></script>
<script type="text/javascript" src="admin/attachcomment/js/myattach.js"></script>
<link href="admin/attachcomment/css/myattach.css" rel="stylesheet" type="text/css" />

<script type="text/javascript">
function showsendmailProject(){
    $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
    $('#fade').css({'filter' : 'alpha(opacity=60)'}).fadeIn(); //Fade in the fade layer       
	
    popup_window_show('#sample', { pos : 'window-center', width : '600px', height:'800px'});
										
	
}
function showUser1(str){
    if (str==""){
        document.getElementById("txtHint").innerHTML="";
        return;
    } 
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }else{// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","ajax/getuser6.php?q="+str+"&id_project="+<?=$id?>,true);
    xmlhttp.send();
}
function showReference1(str){ 
    if (str==""){
        document.getElementById("txtHint1").innerHTML="";
        return;
    } 
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }else{// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            document.getElementById("txtHint1").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","ajax/getreference6.php?idemployee="+str+"&id_project="+<?=$id?>,true);
    xmlhttp.send();
}
function rmReference1(str){ 
    if (str==""){
        document.getElementById("txtHint1").innerHTML="";
        return;
    } 
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }else{// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            document.getElementById("txtHint1").innerHTML=xmlhttp.responseText;
        }
    }
    xmlhttp.open("GET","ajax/rmreference6.php?idemployee="+str,true);
    xmlhttp.send();
}
function sendmail(){
    if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }else{// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function(){
        if (xmlhttp.readyState==4 && xmlhttp.status==200){
            //document.getElementById('showview').setAttribute('style','opacity:1; position:relative;');
            alert("Update list sendmail successfully !!!");
        }
    }
    xmlhttp.open("GET","content-project/sendmail.php?id_project="+<?=$id?>,true);
	
    xmlhttp.send();
}
$(function() {
	$("#dialog-message").dialog({
		autoOpen : false,
		modal : true,
		buttons : {
			<?=$l_close?> : function() {
				$(this).dialog("close");
			}
		}
	});

});
$(function() {
	$("#dialog-messagecomment").dialog({
		autoOpen : false,
		modal : true,
		buttons : {
			<?=$l_close?> : function() {
				$(this).dialog("close");
			}
		}
	});

});

function startCallback() {
	// viáº¿t code khi click nÃºt upload vÃ  báº¯t Ä‘áº§u upload.
	$('#attachloading').append ('<?=$l_uploading?>');
	return true;
}
function startCallbackcomment(){
	$('#attachloadingcomment').append ('<?=$l_uploading?>');
	return true;
}
</script>
<script type="text/javascript" src="js/jquery-1.8.2.js"></script>
<link rel="stylesheet" type="text/css" href="css/jquery-ui.css" />
<script type="text/javascript" src="js/jquery-ui.js"></script>

<script type="text/javascript"
	src="admin/ckeditor_351/ckeditor.js"></script>
<script type="text/javascript"
	src="admin/ckfinder/ckfinder.js"></script>

<style>
.cke_contents {
	height: 250px !important;
}
a[title="Browse Server"]{
	display:none !important;
}
a[title="Duyá»‡t trÃªn mÃ¡y chá»§"]{
	display:none !important;
}
a[title="ì„œë²„ ë³´ê¸°"]{
	display:none !important;
}
a[title="Link"]{
	display:none !important;
}
a[title="LiÃªn káº¿t"]{
	display:none !important;
}
a[title="ë§�í�¬"]{
	display:none !important;
}
a[title="Advanced"]{
	display:none !important;
}
a[title="Tab má»Ÿ rá»™ng"]{
	display:none !important;
}
a[title="ìž�ì„¸ížˆ"]{
	display:none !important;
}
tr td.cke_bottom{
	display:none !important;
}

.comment {margin:20px}
	.comment a {padding:4px 8px; box-shadow: 1px 1px 0px #666; border-radius: 3px; color:white}
	.conf {background:#186d89}
	.fix {background:#488d3b}
	.not_fix {background:#999}
	.comment a:hover {opacity:.7}
	.comment a img {vertical-align:middle; padding-right:4px}
</style>


<link rel="stylesheet" type="text/css" href="admin/css/jsDatePick_ltr.min.css" />

<script type="text/javascript" src="admin/css/jsDatePick.min.1.3.js"></script>

<script type="text/javascript">

    window.onload = function(){

        new JsDatePick({
            useMode:2,
            target:"datefrom",
            dateFormat:"%Y-%m-%d"
        });
        new JsDatePick({
            useMode:2,
            target:"dateto",
            dateFormat:"%Y-%m-%d"
        });

    };

</script>


<script type="text/javascript">
	$(document).ready(function(){
		$('.divinvi:not(:last)').hide();
		$('.divinvi:last').show();
		$('#accordion-js').find('.caption').click(function(){
			$(this).next().slideToggle();

			var editor = CKEDITOR.replace("ncontent");
		    CKFinder.setupCKEditor(editor, 'admin/ckfinder') ;
		});
		bindEventAfterAjax();
		
	}); 

	function cancelAddErr(thamso){
		var link = "#"+thamso;
		$(link).slideToggle();
		//attach
		resetattach();
		document.getElementById('titleerror').style.backgroundColor = '<?="#".$valpriocolor[3]?>';

		//document.getElementById('addnewerror').setAttribute("disabled","disabled");
       	document.getElementById('addnewerror').removeAttribute("disabled");
		document.getElementById('addnewerror').style.display = 'visible';
		document.getElementById('listsendmail').style.display = 'visible';

		document.getElementById('update').setAttribute("disabled","disabled");
       	//document.getElementById('update').removeAttribute("disabled");
		document.getElementById('update').style.visibility='hidden';
		document.getElementById('update').style.display='none';
		document.getElementById('addnewerror').style.display = 'inline';
		document.getElementById('listsendmail').style.display = 'inline';
		CKEDITOR.instances.ncontent.setData('');
		$("#formadderror\\:adderror").htmlarea();
		
		
	}
	
	function bindEventAfterAjax(){
		$("#report tr:not(#mo):even").addClass("odd");
	    $("#report tr:not(.odd):not(#mo)").hide();
	    $("#report tr:last-child").show();
	}
	
	function showthemcommand(ele){
		checkSesssion();
		$(ele).parent().parent().parent().find("#themcommand").toggle();	
	}
	function showthemcommand2(ele){
		checkSesssion();
		$(ele).parent().parent().parent().find("#themtranslate").toggle();	
	}
	function showthemcommand3(ele){
		checkSesssion();
		$(ele).parent().parent().parent().find("#themcause").toggle();	
	}
	function showthemcommand4(ele){
		checkSesssion();
		$(ele).parent().parent().parent().find("#themdeadline").toggle();	
	}
	function closethemcommand(ele){
		checkSesssion();
		$(ele).parent().parent().toggle();	
	}
	
	function closeCommand(){
		$("#report tr.odd:not(#mo)").show();
		$("#report tr:not(.odd):not(#mo)").hide();
	}
	function closethemtranslate(ele){
		checkSesssion();
		$(ele).parent().parent().toggle();	
	}
	
	function closeTranslate(){
		$("#report tr.odd:not(#mo)").show();
		$("#report tr:not(.odd):not(#mo)").hide();
	}
	function closethemcause(ele){
		checkSesssion();
		$(ele).parent().parent().toggle();	
	}
	function closethemdeadline(ele){
		checkSesssion();
		$(ele).parent().parent().toggle();	
	}
	
	function closeCause(){
		$("#report tr.odd:not(#mo)").show();
		$("#report tr:not(.odd):not(#mo)").hide();
	}
	function closeDeadLine(){
		$("#report tr.odd:not(#mo)").show();
		$("#report tr:not(.odd):not(#mo)").hide();
	}
	function javas(ele){
		alert($(ele).parent().find("#ajaxok"))
		$(ele).parent().find("#ajaxok").val("sdfsd");
	}
	
	function javass(ele){
		alert(ele);
		alert(ele.parentNode)
		alert(ele.parentNode.getElementsByTagName("input"));
		x = ele.parentNode.getElementsByTagName("input");
		for (i=0;i<x.length;i++)
		{	
			if (x[i].getAttribute("id")=='ajaxok'){
				x[i].value='luan';
				break;
			}
			
		}
	}
</script>
<script type="text/javascript">

function showdetail(){
	
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	  
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
      
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
		    //alert(xmlhttp.responseText);
	        document.getElementById("ajaxdelete").innerHTML=xmlhttp.responseText;
	        document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
	    }
	  }
	xmlhttp.open("GET","ajax/project_command.php",true);
	xmlhttp.send();
}

var doctitle="";
var doctil="";
var doctilc="424242";

function onclickRadioRed(){
	document.getElementById('buttonred').checked =true;
	document.getElementById('buttonorange').checked =false;
	document.getElementById('buttonyellow').checked =false;

	doctitle = document.getElementById('titleerror');
	doctitle.style.backgroundColor ='<?="#".$valpriocolor[3]?>';
}

function onclickRadioOrange(){
	document.getElementById('buttonred').checked =false;
	document.getElementById('buttonorange').checked =true;
	document.getElementById('buttonyellow').checked =false;

	doctitle = document.getElementById('titleerror');
	doctitle.style.backgroundColor = '<?="#".$valpriocolor[2]?>';
}

function onclickRadioYellow(){
	document.getElementById('buttonred').checked =false;
	document.getElementById('buttonorange').checked =false;
	document.getElementById('buttonyellow').checked =true;

	doctitle = document.getElementById('titleerror');
	doctitle.style.backgroundColor = '<?="#".$valpriocolor[1]?>';
}

function edittile_testproject(idtestproject,idp,idemployee,color,page,tab){
	
	$('#adderror').slideUp();
	$.ajax({url:"ajax/testproject_id.php?id="+idtestproject,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			var title = $(result).find('#title').val();
			var content = $(result).find('#content').html();
			var listattach = $(result).find('#listattach').html();//attach
			document.getElementById('addnewerror').setAttribute("disabled","disabled");
	       	//document.getElementById('addnewerror').removeAttribute("disabled");
			document.getElementById('addnewerror').style.display = 'none';
			document.getElementById('listsendmail').style.display = 'none';
			
			//document.getElementById('update').setAttribute("disabled","disabled");
	       	document.getElementById('update').removeAttribute("disabled");
			document.getElementById('update').style.visibility='visible';
			document.getElementById('update').style.display = 'inline';
	
			var doctil = document.getElementById('titleerror');
			$('#titleerrorhidden').val(color);
			doctil.value= title;
		
			if(color == 2){
				document.getElementById('buttonred').checked =false;
				document.getElementById('buttonorange').checked =true;
				document.getElementById('buttonyellow').checked =false;
	
				doctil.style.backgroundColor ='<?="#".$valpriocolor[2]?>';
				
			}else if(color == 3){
				document.getElementById('buttonred').checked =true;
				document.getElementById('buttonorange').checked =false;
				document.getElementById('buttonyellow').checked =false;
	
				doctil.style.backgroundColor ='<?="#".$valpriocolor[3]?>';
				
			}else if(color == 1){
				document.getElementById('buttonred').checked =false;
				document.getElementById('buttonorange').checked =false;
				document.getElementById('buttonyellow').checked =true;
	
				doctil.style.backgroundColor ='<?="#".$valpriocolor[1]?>';
			}
	
			document.formadderror.idtestproject.value=idtestproject;		
			var ct = content+"";
			CKEDITOR.instances['ncontent'].setData(ct);
			$('#uploadresult').html(listattach);//attach
			$('#adderror').slideDown();
			$('#titleerror').focus();
		}
		
	}});	
}

function setTitleValues_EditPro(){
	if(doctil==""){
		document.formadderror.titleerror.value = document.getElementById('titleerror').value+"-%$#@!-#424242";
	}else{
		alert('color title === ' + document.formadderror.titleerror.value);
		document.formadderror.titleerror.value =doctil;
	}
}

var eleAddComment;
function add_comment(ele)
{
	eleAddComment = ele
	return true;
}

var eleAddTranslate;
function add_translate(ele)
{
	eleAddTranslate = ele
	return true;
}
var eleAddCause;
function add_cause(ele)
{
	eleAddCause = ele
	return true;
}
var eleAddDeadLine;
function add_deadline(ele)
{
	eleAddDeadLine = ele
	return true;
}
function ClickOK(){
	if($('textarea#titlecomment').val()==''){
		$('textarea#titlecomment').focus();
		return;
	}
	else{
		$("#formcomments").submit();
	}
}
function ClickOK1(){
	if($('textarea#titletranslate').val()==''){
		$('textarea#titletranslate').focus();
		return;
	}
	else{
		$("#formtranslates").submit();
	}
}
function ClickOK2(){
	if($('textarea#titlecause').val()==''){
		$('textarea#titlecause').focus();
		return;
	}
	else{
		$("#formcauses").submit();
	}
}
function ClickOK3(){
	//alert($('input#titledeadline').val());
	if($('input#titledeadline').val()==''){
		$('input#titledeadline').focus();
		return;
	}
	else{
		$("#formdeadlines").submit();
	}
}
function add_comment_completed(response){
	if(response=='timeout'){
		   window.open('login.php?timeout=on','_self');
	}else{
	$(eleAddComment).find("#titlecomment").val('');
	$(eleAddComment).find("#stylecolor").val('424242');
	$(eleAddComment).find("#titlecomment").css("color","#424242");
    $(eleAddComment).find("#themcommand").hide();
    $(eleAddComment).find("#uploadresultcomment").empty()
    $(eleAddComment).parent().find('#ajaxcomment').html(response);
    doctilc = "424242";
	}
}


function add_translate_completed(response){
	if(response=='timeout'){
		   window.open('login.php?timeout=on','_self');
	}else{
	$(eleAddTranslate).find("#titletranslate").val('');
    $(eleAddTranslate).find("#themtranslate").hide();
   
    $(eleAddTranslate).find("#titletranslate").css("color","#424242");
    $(eleAddTranslate).find("#themtranslate").hide();
    $(eleAddTranslate).parent().find('#ajaxtranslate').html(response);
    doctilc = "424242";
	}
}
function add_cause_completed(response){
	if(response=='timeout'){
		   window.open('login.php?timeout=on','_self');
	}else{
	$(eleAddCause).find("#titlecause").val('');
    $(eleAddCause).find("#themcause").hide();
   
    $(eleAddCause).find("#titlecause").css("color","#424242");
    $(eleAddCause).find("#themcause").hide();
    $(eleAddCause).parent().find('#ajaxcause').html(response);
    doctilc = "424242";
	}
}
function add_deadline_completed(response){
	if(response=='timeout'){
		   window.open('login.php?timeout=on','_self');
	}else{
	$(eleAddDeadLine).find("#titledeadline").val('');
    $(eleAddDeadLine).find("#themdeadline").hide();
   
    $(eleAddDeadLine).find("#titledeadline").css("color","#424242");
    $(eleAddDeadLine).find("#themdeadline").hide();
    $(eleAddDeadLine).parent().find('#ajaxcomment').html(response);
    doctilc = "424242";
	}
}
function viewcommanderror(indexcomment,idtestproject,id_employee,id,recyclebin,ele)
{
	
		if (window.XMLHttpRequest)
		  {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		  }
		else
		  {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		    {
			  if(xmlhttp.responseText=='timeout'){
				   window.open('login.php?timeout=on','_self');
			   }else{
		        $(ele).parent().parent().parent().next("tr").html(xmlhttp.responseText);
		        $("#report tr.odd:not(#mo)").show();
				$("#report tr:not(.odd):not(#mo)").hide();
				$(ele).parent().parent().parent().hide();
		    	$(ele).parent().parent().parent().next("tr").toggle();
			   }
		    }
		  }
		var lang = '<?=$_SESSION['lang']?>';
		xmlhttp.open("GET","content-project/comment-project-hide.php?indexcomment="+indexcomment+"&idtestproject="+idtestproject+"&id_employee="+id_employee+"&idproject="+id+"&recyclebin="+recyclebin+"&newlang="+lang,true);
		xmlhttp.setRequestHeader("Content-Type", "charset=utf-8");
		xmlhttp.send();
}

function showcommanderror(tempcodetestpro,idtestproject,id_employee,id,recyclebin,ele,page)
{
	
		if (window.XMLHttpRequest)
		  {// code for IE7+, Firefox, Chrome, Opera, Safari
		  xmlhttp=new XMLHttpRequest();
		  }
		else
		  {// code for IE6, IE5
		  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		  }
		xmlhttp.onreadystatechange=function()
		  {
		  if (xmlhttp.readyState==4 && xmlhttp.status==200)
		    {
			   // alert(xmlhttp.responseText);
			   if(xmlhttp.responseText=='timeout'){
				   window.open('login.php?timeout=on','_self');
			   }else{
			   	$("#report tr:not(.odd)").empty()
		        $(ele).parent().parent().parent().next("tr").html(xmlhttp.responseText);
		        $("#report tr.odd:not(#mo)").show();
				$("#report tr:not(.odd):not(#mo)").hide();
				$(ele).parent().parent().parent().hide();
		    	$(ele).parent().parent().parent().next("tr").toggle();
			   }
		    }
		  }
		var lang = '<?=$_SESSION['lang']?>';
		xmlhttp.open("GET","content-project/comment-project-hide.php?tempcodetestpro="+tempcodetestpro+"&idtestproject="+idtestproject+"&id_employee="+id_employee+"&idproject="+id+"&recyclebin="+recyclebin+"&newlang="+lang+"&page="+page,true);
		xmlhttp.setRequestHeader("Content-Type", "charset=utf-8");
		xmlhttp.send();

}

function delete_comment(idcomment,idtestpro,idemployee,ele)
{
	
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
		  	if(xmlhttp.responseText=='timeout'){
			   window.open('login.php?timeout=on','_self');
		   }else{
		    $(ele).parent().parent().parent().parent().html(xmlhttp.responseText);
		    $(ele).parent().parent().parent().parent().parent().parent().find("#titlecomment").val('');
		   }
	    }
	  }
	var lang = '<?=$_SESSION['lang']?>';
	xmlhttp.open("GET","content-project/delete-comment.php?idcomment="+idcomment+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang,true);
	xmlhttp.send();

}

function delete_translate(idcomment,idtestpro,idemployee)
{
	
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
		  	if(xmlhttp.responseText=='timeout'){
			   window.open('login.php?timeout=on','_self');
		   }else{
			   document.getElementById("ajaxtranslate").innerHTML=xmlhttp.responseText;
			
		   // $(ele).parent().parent().parent().parent().html();
		    //$(ele).parent().parent().parent().parent().parent().parent().find("#titletranslate").val('');
		   }
	    }
	  }
	var lang = '<?=$_SESSION['lang']?>';
	xmlhttp.open("GET","content-project/delete-translate.php?idcomment="+idcomment+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang,true);
	xmlhttp.send();

}
function delete_cause(idcomment,idtestpro,idemployee)
{
	
	if (window.XMLHttpRequest)
	  {// code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	  }
	else
	  {// code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	  }
	xmlhttp.onreadystatechange=function()
	  {
	  if (xmlhttp.readyState==4 && xmlhttp.status==200)
	    {
		  	if(xmlhttp.responseText=='timeout'){
			   window.open('login.php?timeout=on','_self');
		   }else{
			   document.getElementById("ajaxcause").innerHTML=xmlhttp.responseText;
			
		   // $(ele).parent().parent().parent().parent().html();
		    //$(ele).parent().parent().parent().parent().parent().parent().find("#titletranslate").val('');
		   }
	    }
	  }
	var lang = '<?=$_SESSION['lang']?>';
	xmlhttp.open("GET","content-project/delete-cause.php?idcomment="+idcomment+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang,true);
	xmlhttp.send();

}
</script>
<script type="text/javascript">
function checkSesssion(){
	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function(){
											  if (xmlhttp.readyState==4 && xmlhttp.status==200){
												  if(xmlhttp.responseText==0)
													  window.open('login.php?timeout=on','_self');
											  }
									  }
	xmlhttp.open("GET","ajax/checkSession.php",true);
	xmlhttp.send();
}
function deletetestProject(idproject,idtestproject,idemp,page){

	var hoi =confirm("<?=$l_areyousure?>");
	if(hoi==true){
	
		var lang = '<?=$_SESSION['lang']?>';
		$.ajax({url:"content-project/deletetestProject.php?idtestproject="+idtestproject+"&idproject="+idproject, success:function(result){
			if(result=='timeout'){
				   window.open('login.php?timeout=on','_self');
			}else{
				$.ajax({url:"content-project/listerror.php?idproject="+idproject+"&idemp="+idemp+"&newlang="+lang+"&page="+page, success:function(result){
					if(result=='timeout'){
						   window.open('login.php?timeout=on','_self');
					}else{
						document.getElementById("aaa").innerHTML=result;
						//document.getElementById('aaa').setAttribute('style','opacity:1; position:relative;');
				        bindEventAfterAjax();
				        new JsDatePick({
				            useMode:2,
				            target:"datefrom",
				            dateFormat:"%Y-%m-%d"
				        });
				        new JsDatePick({
				            useMode:2,
				            target:"dateto",
				            dateFormat:"%Y-%m-%d"
				        });
					}
				}});
			}
	}});
	}

	
}


function onclickError(idproject,idemp,page){
	
	var lang = '<?=$_SESSION['lang']?>';

	/*var body = document.getElementById('aaa');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);*/
    
	$.ajax({url:"content-project/listerror.php?idproject="+idproject+"&idemp="+idemp+"&newlang="+lang+"&page="+page, success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("aaa").innerHTML=result;
			//document.getElementById('aaa').setAttribute('style','opacity:1; position:relative;');
	        bindEventAfterAjax();
	        new JsDatePick({
	            useMode:2,
	            target:"datefrom",
	            dateFormat:"%Y-%m-%d"
	        });
	        new JsDatePick({
	            useMode:2,
	            target:"dateto",
	            dateFormat:"%Y-%m-%d"
	        });
		}
	}});
}

function processReopenTestPro(idproject,idtestpro,idemployee,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-reopen-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
			bindEventAfterAjax();
		}
		document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
        
		}
	});
}
function getFormattedDate(date) {
	  var year = date.getFullYear();
	  var month = (1 + date.getMonth()).toString();
	  month = month.length > 1 ? month : '0' + month;
	  var day = date.getDate().toString();
	  day = day.length > 1 ? day : '0' + day;
	  return year + '-' + month + '-' + day;
	}
function searchProject(co,idproject){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);

    var datefrom=document.getElementById('datefrom').value;
    var dateto=document.getElementById('dateto').value;

    if(co==0){
    	var datefrom=document.getElementById("datefrom").value;
    	var dateto=document.getElementById("dateto").value;
    }

    if(co==1){
    	var d= new Date();
		d.setDate(d.getDate() - 1);
		var dateto= d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		var datefrom= d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		document.getElementById("datefrom").value=getFormattedDate(new Date(datefrom));
		document.getElementById("dateto").value=getFormattedDate(new Date(dateto));
    }
    
    if(co==7){  		
		var d= new Date();
    	var dateto= d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
    	
    	d.setDate(d.getDate() - 7);
		var datefrom= d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		
		

		document.getElementById("datefrom").value=getFormattedDate(new Date(datefrom));
		document.getElementById("dateto").value=getFormattedDate(new Date(dateto));
    }
    
    if(co==30){
    	var d= new Date();
    	var dateto= d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
    	
		d.setMonth(d.getMonth() - 1);
		var datefrom= d.getFullYear()+"-"+(d.getMonth()+1)+"-"+d.getDate();
		document.getElementById("datefrom").value=getFormattedDate(new Date(datefrom));
		document.getElementById("dateto").value=getFormattedDate(new Date(dateto));
    }

    

    var IDSearch=document.getElementById('IDSearch').value;
    var EmployeeSearch=document.getElementById('EmployeeSearch').value;
    var typeSearch=document.getElementById('typeSearch').value;
    var chargerSearch=document.getElementById('chargerSearch').value;
    var typeSearch1='0';
    if(document.getElementById("title1").checked==true) typeSearch1=0;
    else typeSearch1=1;
    var textSearch=document.getElementById('textSearch').value;
    
	$.ajax({url:"content-project/searchProject.php?idproject="+idproject+"&datefrom="+datefrom+"&dateto="+dateto+"&IDSearch="+IDSearch+"&EmployeeSearch="+EmployeeSearch+"&chargerSearch="+chargerSearch+"&typeSearch="+typeSearch+"&typeSearch1="+typeSearch1+"&textSearch="+textSearch,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
			bindEventAfterAjax();
		}
		document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
        
		}
	});
}

function allProject(idproject){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);

    
    
	$.ajax({url:"content-project/allProject.php?idproject="+idproject,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("aaa").innerHTML=result;
			//document.getElementById('aaa').setAttribute('style','opacity:1; position:relative;');
	        bindEventAfterAjax();
	        new JsDatePick({
	            useMode:2,
	            target:"datefrom",
	            dateFormat:"%Y-%m-%d"
	        });
	        new JsDatePick({
	            useMode:2,
	            target:"dateto",
	            dateFormat:"%Y-%m-%d"
	        });
		}
		document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
        
		}
	});
}
function processConfirmTestPro(idproject,idtestpro,idemployee,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
    
	$.ajax({url:"content-project/process-confirm-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
			bindEventAfterAjax();
		}
		document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
		}
	});
}
function processCorrectTestPro(idproject,idtestpro,idemployee,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-correct-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
       		bindEventAfterAjax();
		}
        document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
		}
	});
}
function processChargeTestPro(idproject,idtestpro,idemployee,code,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-charge-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&code="+code+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
       		bindEventAfterAjax();
		}
        document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
		}
	});
}
function processUnChargeTestPro(idproject,idtestpro,idemployee,code,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-uncharge-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&code="+code+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
       		bindEventAfterAjax();
		}
        document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
		}
	});
}
function processCorrectTestPro1(idproject,idtestpro,idemployee,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-correct-testpro1.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
       		bindEventAfterAjax();
		}
        document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
		}
	});
}
function processIncorrectTestPro(idproject,idtestpro,idemployee,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-incorrect-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
       		bindEventAfterAjax();
		}
        document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
		}
	});
}

function processFixedTestPro(idproject,idtestpro,idemployee,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-fixed-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
       		bindEventAfterAjax();
		}
        document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
		}
	});
}

function processNotFixTestPro(idproject,idtestpro,idemployee,page,els){
	
	var lang = '<?=$_SESSION['lang']?>';
	var body = document.getElementById('ajaxdelete');
	body.setAttribute('style','opacity:.5; position:relative;cursor: wait;  ');
	
	var d=document.createElement('div');
	d.setAttribute('style','display: block;visibility: visible; position: absolute;  z-index: 999; top: 0px; left: 0px; width: 105%; height: 105%; text-align: center;  filter: alpha(opacity=5); opacity: 0.5; ');
	
	var image=document.createElement('img');
	image.setAttribute('src','images/loading1.gif');
	image.setAttribute('style','position:absolute; left:0px; top:0px; right:0; bottom:0; margin:auto');
	
	d.appendChild(image);
	
    body.appendChild(d);
	$.ajax({url:"content-project/process-notfix-testpro.php?idproject="+idproject+"&idtestpro="+idtestpro+"&idemp="+idemployee+"&newlang="+lang+"&tab=1"+"&page="+page,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}else{
			document.getElementById("ajaxdelete").innerHTML=result;
			bindEventAfterAjax();
		}
		document.getElementById('ajaxdelete').setAttribute('style','opacity:1; position:relative;');
        
		}
	});
}
/* Lien*/

function click_addnewfeature(type){
	
	$.ajax({url:"content-project/nf_aj_addnewfeatures.php",data:{type:type},success:function(rs){
		$("#id_nfadd").html(rs);
	}});
}

function add_content_newfeature(){
	
	var vlisttester=document.getElementById("vlisttester").value;
	var vidpro=document.getElementById("vidpro").value;
	var title=document.getElementById("nfadd_title").value;
	var content=document.getElementById("nfadd_content").value;
	var vidviewpro=document.getElementById("vidviewpro").value;
	if(vidpro!="" && title!=""){
		$.ajax({url:"content-project/nf_aj_addcontent_newfeature.php",data:{listtester:vlisttester,vidpro:vidpro,title:title,content:content,vidviewpro:vidviewpro},success:function(rs){
			load_content_newfeature();
			click_addnewfeature('cancel');
		}});
	}else{
		alert("Bạn chưa nhập dữ liệu");
		document.getElementById("nfadd_title").focus();
	}
}

function load_content_newfeature(){
	
	var vidpro=document.getElementById("vidpro").value;
	var vidviewpro=document.getElementById("vidviewpro").value;
	if(vidpro!=""){
		$.ajax({url:"content-project/nf_aj_loadnewfeature.php",data:{vidpro:vidpro,vidviewpro:vidviewpro},success:function(rsall){
			$("#id_nflist").html(rsall);
		}});
	}
}

function showcomment_newfunction(vitri,idnf){
	
	var vidviewpro=document.getElementById("vidviewpro").value;
	var lastview=document.getElementById("nf_lastshowdetail").value;
	if(lastview!=""){
		document.getElementById("nf_lastshowdetail").value=vitri;
		$.ajax({url:"content-project/nf_aj_hidedetail_newfeature.php",data:{vitri:lastview,vidviewpro:vidviewpro},success:function(rshideshowcomment){
			$("#idviewnewfeature"+lastview).html(rshideshowcomment);
			showdetailcomment_newfunction(vitri,idnf,vidviewpro);
		}});
	}else{
		document.getElementById("nf_lastshowdetail").value=vitri;
		showdetailcomment_newfunction(vitri,idnf,vidviewpro);
	}
}

function showdetailcomment_newfunction(vitri,idnf,vidviewpro){
	
	$.ajax({url:"content-project/nf_aj_showcomment_newfeature.php",data:{vitri:vitri,idnf:idnf,vidviewpro:vidviewpro},success:function(rsshowcomment){
		$("#idviewnewfeature"+vitri).html(rsshowcomment);
	}});
}

function close_showdetail_newfeature(vitri,vidviewpro){
	
	document.getElementById("nf_lastshowdetail").value="";
	$.ajax({url:"content-project/nf_aj_hidedetail_newfeature.php",data:{vitri:vitri,vidviewpro:vidviewpro},success:function(rsclosedetail){
		$("#idviewnewfeature"+vitri).html(rsclosedetail);
	}});
}

function sendEmailNewVersion(arraytester,namepro){
	
	$.ajax({url:"content-project/ajax-sendmail-newversion.php?arraytester="+arraytester+"&namepro="+namepro,success:function(result){
		if(result=='timeout'){
			   window.open('login.php?timeout=on','_self');
		}
		//	alert("aaa ="+result);
		}
	});
}
</script>

<div class="main_content" id="accordion-js">
<?php while ($row=mysql_fetch_array($querydetail)){ $idmanager = $row[IDManager];
if($row[IDManager]==$_SESSION['IDEmployee']){
	$_SESSION['posmanager']=1;
}
$_SESSION['idviewpro']=$row['IDView'];
$queryManger =mysql_query("SELECT emp.FullName FROM employee emp WHERE emp.IDEmployee = '$idmanager'" );


?>

	<div class="projectInfo">
		<input type="hidden" id="vidviewpro" value="<?=$row['IDView']?>" />
		<span class="caption"><?php echo $l_project?> : <i><?php echo $row['NameProject']?>
		</i> </span><?php $_SESSION['namepro_temp']=$row['NameProject'];?>
		<div class="divinvi" style="display: none">
			<table width="100%" cellspacing="5" cellpadding="0">
				<tr>
					<td width="150">- <?php echo $l_start_date?> :</td>
					<td class="underline"><?php echo $row['DateStart']?></td>
				</tr>
				<tr>
					<td width="150">- <?php echo $l_manager?> :</td>
					<?php while ($r = mysql_fetch_array($queryManger)){?>
					<td class="underline"><?php echo  $r['FullName'];}?>
					</td>
				</tr>
				<tr>
					<td width="150">- <?php echo $l_status?> :</td>
					<td class="underline"><?php 
					if($row[Status]==0){
						echo $l_status_project_no;
					}else{
						echo $l_status_project_done;
					}
					?>
					</td>
				</tr>
				<tr>
					<td width="150">- <?php echo $l_description?> :</td>
					<td class="underline"><?php echo $row['Description']?></td>
				</tr>
			</table>
		</div>
	</div>
	<?php }?>
	<div class="teamPro">
		<a class="caption"><?php echo $l_listmember?> </a>
		<div class="divinvi" style="display: none">
			<table cellspacing="3" width="100%" style="margin-bottom: 20px"
				class="listCom">
				<tr>
					<td class="titleComp"><?php echo $l_tester_team?></td>
					<td class="titleComp"><?php echo $l_coder_team?></td>
				</tr>
				<tr>
					<?php 
					$row_array = array();
					$index = 0;
					$mangtester='';
					while ($row = mysql_fetch_array($queryLstMember)){
							$row_array[$index][0] = $row['IDEmployee'];
							$row_array[$index][1] = $row['Position'];
							$row_array[$index][2] = $row['FullName'];
							$row_array[$index][3] = $row['Status'];
							if($row[Position]==0 && $row['REmail']==1){
								if($mangtester==''){
									$mangtester=$row['IDEmployee'];
								}else{
									$mangtester .=",".$row['IDEmployee'];
								}
							}
							$index += 1;
						}
						$_SESSION['mangtestererror']=$mangtester;
						?>
					<td style="vertical-align: top">
						<ul class="composition">
						<?php 
						foreach ($row_array as $row){
						if(($row[0]==$_SESSION['IDEmployee']) && ($row[1]==0)){
							$_SESSION['postest']=1;
						}
						if($row[1]==0){?>
							<li class="itemCom"><?php 	echo $row[2];
							if($row[3]==1) echo "<font style='font-weight: bold;'> (Not working)</font>";
							?>
							</li>
							<?php }} ?>
						</ul>
					</td>
					<td style="vertical-align: top">
						<ul class="composition">
						<?php
						foreach ($row_array as $rowCoder){
							if(($rowCoder[0]==$_SESSION['IDEmployee']) && ($rowCoder[1]==1)){
								$_SESSION['poscoder']=1;
							}
							 if($rowCoder[1]==1){?>
								<li class="itemCom"><?php 	echo $rowCoder[2];
									if($rowCoder[3]==1) echo "<font style='font-weight: bold;'> (Not working)</font>";
									?>
								</li>
								<?php } ?>
							<?php }?>
						</ul>
					</td>
				</tr>
			</table>
			<?php if($_SESSION['posmanager']==1){?>
			<div align="right" style="margin-top:10px">
			<a href="project_admin.php?content=admin/project/updatecomposition.php&id=<?=$id?>&status=0"><span class="buttonProject" style="padding: 5px; border:1px solid #999"><?=$l_update?></span></a>
			</div>
			<?php }?>
		</div>
	</div>
	<?php
	if($role==1 || ($_SESSION['posmanager']==1) || ($_SESSION['postest']==1)) {?>
	<script type="text/javascript">
		$(document).ready(function() {
			  var editor = CKEDITOR.replace("ncontent",{language:"<?php $lang_current = $_SESSION['lang'];
		if (isset($lang_current)) {
			if ($lang_current=='VN'){
				echo 'vi';
			}else if ($lang_current=='KR') {
				echo 'ko';
			}
			else{
				echo 'en';
			}
		}
		else{
			echo 'en';
		} ?>", height:'100%', width:'100%'});
				    CKFinder.setupCKEditor(editor, 'admin/ckfinder') ;
			});
				
	</script>
	<div class="newError" id="ajaxedittitletestpro" >
	
		<?php if($_SESSION['posmanager']==1) {?>
	<script type="text/javascript">
		$(document).ready(function() {
			  var editor1 = CKEDITOR.replace("ncontent1",{language:"<?php 
			  	$lang_current = $_SESSION['lang'];
				if (isset($lang_current)) {
					if ($lang_current=='VN'){
						echo 'vi';
					}else if ($lang_current=='KR') {
						echo 'ko';
					}
					else{
						echo 'en';
					}
				}
				else{
					echo 'en';
				} 
																		?>", height:'100%', width:'100%'});
				    CKFinder.setupCKEditor(editor1, 'admin/ckfinder') ;
			});

		
	</script>
		<div id="troioi" style="width:100%; display:block" >
			<a class="caption"  onclick="checkSesssion()"><?php echo $l_themtinhnang?> </a>
			<div class="rf-p divinvi" style="width: 100%; display:none" id="adderror1">
				<form action="content-project/nf_process_addfeature.php" method="get" name="formadderror1" id="formadderror1" onsubmit="if($('#titleerror1').val()==''){$('#titleerror1').focus();return false;}else{return true;}">
				<div class="rf-p-b" >
					 <input type="hidden" id="vidpro" name='id' value="<?=$id?>" />
					 <input type="hidden" name='page' value="<?=$page?>" id="page"/>
					 <input type="hidden" name='tab' value="<?=$tab?>" id="tab"/>
					 <input type="hidden" name="idtestproject" id="idtestproject" value=""/>
						 <span style="display: block; text-align: left"><?php echo $l_title?>:</span> 
						 <input type="text" class="intext" style="color: #424242;" name="titleerror1" id="titleerror1" />
						 <input type="hidden" class="intext" style="color: #424242;background-color: #FFFFB0" value='FFFFB0' name="titleerrorhidden1" id="titleerrorhidden1" />
						 <br/>
						 <span style="display: block; text-align: left"><?php echo $l_content?>: </span>
						 <textarea rows="" cols="" id="ncontent1" class="ncontent" name="ncontent1" style="width: 100%"></textarea>
						 <table width="100%">
						  <tr> 
							  <td style="text-align:left"> 
							  </td> 
							  <td style="text-align:right" valign="top" > 
								  <input class="buttonProject" onclick="waiting_addnewfeature()" type="submit" style="margin: 5px 0;" id="addnewerror1" name="addnewerror1" value="<?=$l_add?>" />
							      <input class="buttonProject"  type="submit" style="margin: 5px 0;visibility: hidden;display: none;"  id="update1" name="update1" value="<?=$l_update?>" />
								  <input class="buttonProject"  type="reset" onclick="return cancelAddErr('adderror1');$('#formadderror1:adderror1').value='';" style="margin: 5px 0;" value="<?php echo $l_cancel?>" />
							  </td> 
						  </tr>
						</table>
					<div style="text-align: right">
					</div>
				</div>
				</form>	
			</div>
		</div>
	<?php }?>
	
	
		<a class="caption" onclick="checkSesssion()" ><?php echo $l_add_error?> </a>
		<div class="rf-p divinvi" style="width: 100%; display:none" id="adderror">
			<form action="content-project/process-adderror.php" method="get" name="formadderror" id="formadderror" onsubmit="if($('#titleerror').val()==''){$('#titleerror').focus();return false;}else{return true;}">
			<div class="rf-p-b">
				<ul class="buttonColor">
					<li style="vertical-align: middle">
						<input type="radio" name="priorityID" id="buttonred" onclick="onclickRadioRed();" style="vertical-align: middle;"  value="3" checked="checked"/> <label style="vertical-align: middle;" onclick="onclickRadioRed();"><?=$l_priority3?></label>
					</li>
					<li style="vertical-align: middle">
						<input type="radio" name="priorityID" id="buttonorange" onclick="onclickRadioOrange();" style="vertical-align: middle;"  value="2"/> <label style="vertical-align: middle;" onclick="onclickRadioOrange();"><?=$l_priority2?></label>
					</li>
					<li style="vertical-align: middle">
						<input id="buttonyellow" type="radio" name="priorityID"  onclick="onclickRadioYellow();" style="vertical-align: middle;"  value="1"/> <label style="vertical-align: middle;" onclick="onclickRadioYellow();"><?=$l_priority1?></label>
					</li>
				</ul>
				<br class="clear" />
				 <input type="hidden" id="vidpro" name='id' value="<?=$id?>" />
				 <input type="hidden" name='page' value="<?=$page?>" id="page"/>
				 <input type="hidden" name='tab' value="<?=$tab?>" id="tab"/>
				  <input type="hidden" name='idtestproject'/>
					 <span style="display: block; text-align: left"><?php echo $l_title?>:</span>
					 <input type="text" class="intext" style="color: #424242;background-color: <?="#".$valpriocolor[3]?>" name="titleerror" id="titleerror" />
					 <input type="hidden" class="intext" style="color: #424242;background-color: <?="#".$valpriocolor[3]?>" value='FFFFB0' name="titleerrorhidden" id="titleerrorhidden" />
					 <br/>
					 <span style="display: block; text-align: left"><?php echo $l_content?>: </span>
					 <textarea rows="" cols="" id="ncontent" class="ncontent" name="ncontent" style="width: 100%"></textarea>
					
					 <table width="100%">
					  <tr>
						  <td style="text-align:left">
						  <div style='float: left'>
							  <a  onkeydown="return CKEDITOR.tools.callFunction(0, 12, event);"
							 id=cke_21 class="cke_off cke_button_image"
							   title='<?=$insert_image?>' role=button tabIndex=-1 aria-labelledby=cke_21_label
							   onclick="CKEDITOR.tools.callFunction(17, this); return false;" href="javascript:void('Image')" ? unselectable="on">
								  <input class="buttonProject" type="button" style="margin: 5px 0;" value="<?=$insert_image?>" /> 
							  </a>
							</div>						
						 <div style='float: left;padding-top:2px;margin-left:20px'>
						  <?php include 'admin/attach/attach.php';?>
						  </div>
						  </td> 
						  <td style="text-align:right" valign="top" > 
						  	  <input class="buttonProject" type="button" style="margin: 5px 0;" onclick="showsendmailProject()" id="listsendmail" name="listsendmail" value="<?php echo $l_sendmail;?>" />
							  <input class="buttonProject" type="submit" style="margin: 5px 0;" id="addnewerror"  name="addnewerror" value="<?php echo $l_add_error?>" />
						      <input class="buttonProject"  type="submit" style="margin: 5px 0;visibility: hidden;display: none;" disabled="disabled" id="update" name="update" value="<?=$l_update?>" />
							  <input class="buttonProject"  type="reset" onclick="return cancelAddErr('adderror');$('#formadderror:adderror').value='';" style="margin: 5px 0;" value="<?php echo $l_cancel?>" />
						  </td> 
					  </tr>
					</table>
				<div style="text-align: right"></div>
			</div>
			</form>	
		</div>
		
	<?php }?>
	<div style="margin-top: 10px; width: 100%;" id="aaa">
	<?php 
		$tabi = "include-list-error-pro.php";
	if (isset($_REQUEST['tab'])) {
		if ($_REQUEST['tab']==1) {
			$tabi = "include-list-error-pro.php";
		}else{
			$tabi = "include-new-features.php";
		}
	}
	include $tabi;?>
	</div>
</div>
    <?php include 'admin/attach/attachhidden.php';?>
				<?php include 'admin/attachcomment/attachhidden.php';?>